package com.tidc.consumer8001.controller.user;

import com.tidc.commonality.api.AuthenticationApi;
import com.tidc.consumer8001.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassNmae userController
 * @Description TODO
 * @Author 冯涛滔
 **/
@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController {
	@Autowired
	private AuthenticationApi authorizationApi;
	@PostMapping("/login")
	public Object checkRank(@RequestBody Student student){
		System.out.println(student);
		return authorizationApi.login(student.getEmail(),student.getPassword(),"TIDC","computer","password");
	}
	@RequestMapping(value = "/info",method = RequestMethod.GET)
	public Object userInfo(@RequestParam(value = "access_token")String access_token){
		return authorizationApi.userInfo(access_token);
	}
}
